package com.clstu.enum_.homework;

public class HomeWork02 {
    public static void main(String[] args) {
        Animal[] arr=new Animal[2];
        arr[0]=new Cat();
        arr[1]=new Dog();
        for (int i = 0; i < 2; i++) {
            arr[i].shout();
        }
    }
}
abstract class Animal{
    abstract public void shout();
}
class Dog extends Animal{
    @Override
    public void shout() {
        System.out.println("Dong Wang wang wang ....");
    }
}

class Cat extends Animal{
    @Override
    public void shout() {
        System.out.println("Cat miao miao miao ...");
    }
}